/**
*  \file production.c
*
*  \brief  production parameter.
*
*  \author   paragen.py
*  \author   Michael J. Hohmann <michael.hohmann@linde-mh.de>
*
*
*/

/*===============================================[ private includes  ]================================================*/
#include "production.h"
#include <stddef.h>
#include "../cfg/production_cfg.h"

/*===============================================[ private defines   ]================================================*/
#ifndef PRODUCTION_FINGERPRINT_0x7B2022E4AEBC7AE92290264843CE81CA
#error /* header has wrong version */
#endif
/*===============================================[ private datatypes ]================================================*/

/* entries: 8   */ 
struct production_parameter_info
{
   struct paragen_type_u16_mm encode_step;
   struct paragen_type_s8_mm swap_encoder;
   struct paragen_type_ch_mm vin;
   struct paragen_type_u32_mm reserve0;
   struct paragen_type_u32_mm reserve1;
   struct paragen_type_u32_mm reserve2;
   struct paragen_type_u32_mm reserve3;
   struct paragen_type_u32_mm reserve4;
}; 

/*===============================================[ private variables ]================================================*/

static const struct production_parameter production_default_parameter=
{
   64,                        //encode_step,
   0,                         //swap_encoder,
   "000000000000",            //vin,
   0,                         //reserve0,
   0,                         //reserve1,
   0,                         //reserve2,
   0,                         //reserve3,
   0,                         //reserve4
};

static const struct production_parameter_info production_info=
{
   { { paragen_type_u16_mm, offsetof(struct production_parameter, encode_step), U32_CONST(0x00000003),U32_CONST(0x00000001) }, 0, 65535,1 },
   { { paragen_type_s8_mm, offsetof(struct production_parameter, swap_encoder), U32_CONST(0x00000003),U32_CONST(0x00000001) }, 0, 1,1 },
   { { paragen_type_ch_mm, offsetof(struct production_parameter, vin), U32_CONST(0x00000003),U32_CONST(0x00000001) }, 13, 13,1 },
   { { paragen_type_u32_mm, offsetof(struct production_parameter, reserve0), U32_CONST(0x00000000),U32_CONST(0x00000000) }, 0, 0,0 },
   { { paragen_type_u32_mm, offsetof(struct production_parameter, reserve1), U32_CONST(0x00000000),U32_CONST(0x00000000) }, 0, 0,0 },
   { { paragen_type_u32_mm, offsetof(struct production_parameter, reserve2), U32_CONST(0x00000000),U32_CONST(0x00000000) }, 0, 0,0 },
   { { paragen_type_u32_mm, offsetof(struct production_parameter, reserve3), U32_CONST(0x00000000),U32_CONST(0x00000000) }, 0, 0,0 },
   { { paragen_type_u32_mm, offsetof(struct production_parameter, reserve4), U32_CONST(0x00000000),U32_CONST(0x00000000) }, 0, 0,0 }
};

static const struct paragen_index  production_index[]=
{
   { 0x000007D0, (struct paragen_type_header*) &production_info.encode_step },
   { 0x000007D1, (struct paragen_type_header*) &production_info.swap_encoder },
   { 0x000007D2, (struct paragen_type_header*) &production_info.vin },
   { 0x000007D3, (struct paragen_type_header*) &production_info.reserve0 },
   { 0x000007D4, (struct paragen_type_header*) &production_info.reserve1 },
   { 0x000007D5, (struct paragen_type_header*) &production_info.reserve2 },
   { 0x000007D6, (struct paragen_type_header*) &production_info.reserve3 },
   { 0x000007D7, (struct paragen_type_header*) &production_info.reserve4 }
};

struct production_parameter production_parameter_ram;

/*===============================================[ public variables  ]================================================*/

/** Parameter pointer
*  Pointer to read the Parameter from application
*/
struct production_parameter const * const production = &production_parameter_ram;

const struct paragen_object production_obj =
{
   PRODUCTION_SD,
   (void*) &production_parameter_ram,
   (U32) PRODUCTION_ADDRESS,
   production_index,
   (struct paragen_type_header *) &production_info,
   (void*) &production_default_parameter,
   sizeof( struct production_parameter ),
   sizeof production_index /sizeof(struct paragen_index ),
   {0x7B,0x20,0x22,0xE4,0xAE,0xBC,0x7A,0xE9,0x22,0x90,0x26,0x48,0x43,0xCE,0x81,0xCA} /* finger print */ 
};

/*===============================================[ private functions ]================================================*/

/*====================================================================================================================*/


/***********************************************************************************************************************
*                             Copyright 2020 Linde Material Handling. All rights reserved.                             *
***********************************************************************************************************************/
